package com.ruoyi.supermarket.service.impl;

import java.util.List;

import com.ruoyi.supermarket.bo.DateOrderBo;
import com.ruoyi.supermarket.bo.OrderInfoBo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.supermarket.mapper.OrderMapper;
import com.ruoyi.supermarket.domain.Order;
import com.ruoyi.supermarket.service.IOrderService;

/**
 * 订单信息Service业务层处理
 *
 * @author wqr
 * @date 2024-07-22
 */
@Service
public class OrderServiceImpl implements IOrderService
{
    @Autowired
    private OrderMapper orderMapper;

    /**
     * 查询订单信息
     *
     * @param oid 订单信息主键
     * @return 订单信息
     */
    @Override
    public Order selectOrderByOid(Long oid)
    {
        return orderMapper.selectOrderByOid(oid);
    }

    /**
     * 查询订单信息列表
     *
     * @param order 订单信息
     * @return 订单信息
     */
    @Override
    public List<Order> selectOrderList(Order order)
    {
        return orderMapper.selectOrderList(order);
    }

    /**
     * 新增订单信息
     *
     * @param order 订单信息
     * @return 结果
     */
    @Override
    public int insertOrder(Order order)
    {
        return orderMapper.insertOrder(order);
    }

    /**
     * 修改订单信息
     *
     * @param order 订单信息
     * @return 结果
     */
    @Override
    public int updateOrder(Order order)
    {
        return orderMapper.updateOrder(order);
    }

    /**
     * 批量删除订单信息
     *
     * @param oids 需要删除的订单信息主键
     * @return 结果
     */
    @Override
    public int deleteOrderByOids(Long[] oids)
    {
        return orderMapper.deleteOrderByOids(oids);
    }

    /**
     * 删除订单信息信息
     *
     * @param oid 订单信息主键
     * @return 结果
     */
    @Override
    public int deleteOrderByOid(Long oid)
    {
        return orderMapper.deleteOrderByOid(oid);
    }

    //售出管理
    @Override
    public List<Order> sell(Order order)
    {
        return orderMapper.sellList(order);
    }


    @Override
    public List<OrderInfoBo> getOrderInfo()
    {
        return orderMapper.getOrderInfo();
    }

    @Override
    public List<DateOrderBo> getDateOrder()
    {
        return orderMapper.getDateOrder();
    }
}
